//
//  BVWorkoutModel.m
//  AFNetworking
//
//  Created by xiute on 2019/10/22.
//

#import "BVWorkoutModel.h"

@implementation BVDateModel

- (NSDate *)date {
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    dateFormat.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
    [dateFormat setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SZZZZZ"]; //iso 8601 format
    NSDate *output = [dateFormat dateFromString:self.iso];
    return output;
}

- (BVHomeHeaderCollectionCellType)dateType {
    if ([self.date isToday]) {
        return BVHomeHeaderCollectionCellTypeToday;
    }else if ([self.date isYesterday]) {
        return BVHomeHeaderCollectionCellTypeYesterday;
    }else {
        return BVHomeHeaderCollectionCellTypeDate;
    }
}

@end

@implementation BVWorkoutModel

@end
